<!DOCTYPE html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <title>管理员列表</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="../../css/bootstrap.min.css">
    <link rel="stylesheet" href="../../css/font-awesome.min.css">
    <link rel="stylesheet" href="../../plugins/jqgrid/ui.jqgrid-bootstrap.css">
    <link rel="stylesheet" href="../../../plugins/bootstrap-treeview/bootstrap-treeview.css">
    <link rel="stylesheet" href="../../plugins/ztree/css/metroStyle/metroStyle.css">
    <link rel="stylesheet" href="../../css/main.css">
    <script src="../../libs/jquery.min.js"></script>
    <script src="../../plugins/layer/layer.js"></script>
    <script src="../../libs/bootstrap.min.js"></script>
    <script src="../../libs/vue.min.js"></script>
    <script src="../../plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="../../plugins/jqgrid/jquery.jqGrid.min.js"></script>
    <script src="../../plugins/ztree/jquery.ztree.all.min.js"></script>
    <script src="../../js/common.js"></script>
    <script src="../../js/common2.js"></script>

    <style>
        .form-control2 {
            width: 64%;
            display: inline-block;
            height: 30px;
            padding: 6px 12px;
            font-size: 13px;
            line-height: 1.42857143;
            color: #555;
            background-color: #fff;
            background-image: none;
            border: 1px solid #ccc;
            border-radius: 4px;
            -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
            box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
            -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
            -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
            transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s
        }

        .col-sm-3 {
            width: 300px;
        }

    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList" id="condition">
        <div class="grid-btn" style="overflow: visible; height: 40px;">
            <div class="form-group col-sm-3">
                <input type="text" class="form-control2" v-model="q.username" @keyup.enter="query" placeholder="用户名">
            </div>
            <div class="form-group col-sm-3">
                <div class="input-margin">
                    <label class="input-label">&nbsp; &nbsp;&nbsp;部门：</label>
                    <input type="text" id="txt_department" v-model="q.deptName" class="form-control2"
                           onclick="$('#treeview').show()" readonly="readonly"
                           placeholder="所属部门">
                    <div id="treeview"
                         style="display: none;z-index: 9999;position: absolute;width:230px; left: 75px; height: 400px;overflow:auto;"></div>
                </div>
            </div>
            <div class="form-group col-sm-3">
                <div class="input-margin">
                    <label class="input-label">姓名：</label>
                    <select class="form-control2" v-model="q.uid" id="txt_realName">
                        <option value="">=全部=</option>
                        <option v-for="item in dicUser" v-bind:value="item.userId">
                            {{ item.nickname }}
                        </option>
                    </select>
                </div>
            </div>

        </div>
        <div class="grid-btn" style="overflow: visible; height: 40px;">
            <a class="btn btn-default" @click="query">查询</a>
            <a v-if="hasPermission('sys:user:save')" class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            <a v-if="hasPermission('sys:user:update')" class="btn btn-primary" @click="update"><i
                    class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            <a v-if="hasPermission('sys:user:delete')" class="btn btn-primary" @click="del"><i
                    class="fa fa-trash-o"></i>&nbsp;删除</a>

            <a v-if="hasPermission('sys:user:untie')" class="btn btn-primary" @click="untieUser"><i
                    class="fa fa-pencil-square-o"></i>&nbsp;解绑二次验证</a>
            <a v-if="hasPermission('sys:user:addcreate')" class="btn btn-primary" @click="showAddcreate"><i
                    class="fa fa-pencil-square-o"></i>&nbsp;增加新增账号次数</a>
        </div>

    </div>
    <div v-show="!showList" class="panel panel-default" style="border: none;box-shadow:none;">
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">用户名</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.username" placeholder="登录账号"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">姓名</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.nickname" placeholder="姓名"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">所属部门</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" style="cursor:pointer;" v-model="user.deptName"
                           @click="deptTree" readonly="readonly" placeholder="所属部门"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">工号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.jobNum" placeholder="工号"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">密码</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.password" placeholder="密码"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">邮箱</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.email" placeholder="邮箱"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">手机号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.mobile" placeholder="手机号"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">角色</div>
                <div class="col-sm-10">
                    <label v-for="role in roleList" class="checkbox-inline">
                        <input type="checkbox" :value="role.roleId" v-model="user.roleIdList"/>{{role.roleName}}
                    </label>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">状态</div>
                <label class="radio-inline">
                    <input type="radio" name="status" value="1" v-model="user.status"/> 禁用
                </label>
                <label class="radio-inline">
                    <input type="radio" name="status" value="0" v-model="user.status"/> 正常
                </label>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                <!--&nbsp;&nbsp;<input type="button" class="btn btn-warning" id="btnback" @click="reload" value="返回"/>-->
            </div>
        </form>
    </div>
</div>
<!-- 选择部门 -->
<div id="deptLayer" style="display: none;padding:10px;">
    <ul id="deptTree" class="ztree"></ul>
</div>
<table id="jqGrid"></table>
<div id="jqGridPager"></div>

<script src="../../js/modules/sys/user.js"></script>
<script src="../../../plugins/bootstrap-treeview/bootstrap-treeview.js"></script>
</body>
</html>